type IDType = number | string

type ResType = number extends IDType ? true : false

function sum<T extends number | string>(arg1: T, arg2: T): T extends number ? number : string
function sum(arg1: any, arg2: any) {
    return arg1 + arg2
}

sum(1, 2)

export { }